import os

mlist = os.listdir('json')
index = 0

try:
    mlist.remove("aConfig.json")
    mlist.remove("aConfig")
except:
    index = 0

    
confFile = open('json/aConfig.json',"w")
congList = ['{\n']
flist = []

for index in range(len(mlist)):
    file = open('json/' + mlist[index], 'r')
    tmplist = file.readlines();
    flist += tmplist[1:-1]
    if index != len(mlist)-1:
        flist += [',']
    
    file.close()


print(flist)
congList += flist
congList += ['}']

confFile.writelines(congList)
confFile.close()
